package org.yray.io.rocketmqdemo.controller;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.yray.io.rocketmqdemo.produce.MqProducer;

@RestController
@RequestMapping("/mq")
public class MqMessageController {
    private static final Logger log = LoggerFactory.getLogger(MqMessageController.class);


    @Autowired
    MqProducer mqProducer;

    @GetMapping("/pushMessage")
    public String  pushMessage(@RequestParam("id") String id) {
        mqProducer.sendMsgToMq("Hello,MyId is"+id);
        mqProducer.sendDelayMsgToMq("Hello，Delay,MyId is"+id);
        return "succ";
    }

}